package tech.wenxu.ssoprovider.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author zhaowenxu
 * @date 2020/4/13 15:03
 */
@Data
@TableName("tb_user")
public class User extends BasePojo {

    private static final long serialVersionUID = -8971626312415928958L;

    @TableId(type = IdType.AUTO)
    private Long id;

    @NotBlank(message = "用户名称不能为空")
    private String username;

    @JsonIgnore
    @NotBlank(message = "密码不能为空")
    private String password;

    @NotNull(message = "手机号不能为空")
    private String phone;

    @NotNull(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

}
